#include <bits/stdc++.h>

using namespace std;

const int MAXN = 1e5+10;

bitset<410> f[410],g;
int x[MAXN],y[MAXN],ans,n,m;

int main (){
	scanf("%d %d",&n,&m);
	for(int i = 1;i <= m;i++) scanf("%d %d",&x[i],&y[i]);
	for(int i = 1;i <= n;i++){
		f[i][i] = 1;
		for(int j = m;j;j--){
			int a = x[j],b = y[j];
			if(f[i][a] && f[i][b]) g[i] = 1;
			if(f[i][a]) f[i][b] = 1;
			else if(f[i][b]) f[i][a] = 1;
		}
	}
	for(int i = 1;i <= n;i++){
		if(g[i]) continue;
		for(int j = i+1;j <= n;j++){
			if(!g[j] && (f[i] & f[j]).count() == 0) ans ++;
		}
	}
	printf("%d\n",ans);
	return 0;
}
